<template>
  <div>
    <el-card style="padding: 10px; width: 100%">
      <el-row>
        <el-form ref="form" :inline="true" label-position="top" :model="listPage">
          <el-col :span="18">
            <el-form-item v-for="(item,index) in formItemList" :key="index" :label="item.label">
              <el-select v-if="item.type==='select'" v-model="listPage[item.param]" placeholder="请选择">
                <el-option v-for="(item2,index2) in item.selectOptions" :key="index2" :label="item2.name" :value="item2.value" />
              </el-select>
              <el-input v-if="item.type==='input'" v-model="listPage[item.param]" placeholder="请输入" />
            </el-form-item>
          </el-col>
          <el-col
            :span="6"
            class="btn"
            style="padding-right: 20px; height: 100%; margin-top: 18px;"
          >
            <div style="float: right">
              <el-button type="primary" round @click="serchPage">
                搜索
              </el-button>
              <el-button round style="margin-left: 20px" @click="resetPage"> 重置 </el-button>
            </div>
          </el-col>
        </el-form>
      </el-row>
    </el-card>
  </div>
</template>

<script>
export default {
  props: {
    formItemList: {
      type: Array,
      default: () => {}
    },
    listPage: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
    }
  },
  methods: {
    serchPage() { // 搜索
      this.$emit('searchPage', this.listPage)
    },
    resetPage() { // 重置
      this.$emit('resetEvent')
    }
  }
}
</script>

<style lang='scss' scoped>
::v-deep .el-form-item{
  width: 30%;
  padding: 0;
  margin:0;
  margin-right: 25px;
  .el-select{
    width:100% ;
  }
}
::v-deep .el-input__inner {
  background-color: #f8f5f5;
}
.btn{
  transform: translateY(20px);
}
</style>
